@extends('admin.public')

@section('content')
    <div class="col-md-12">
        <section class="panel panel-default text-sm doc-buttons">
            <div class="panel-body">
                <a href="{{ route('admin.box.box_add') }}" class="btn btn-info"><i
                            class="icon-plus ico"></i>
                    &nbsp; 添加内容盒子</a>
            </div>
        </section>
    </div>

    <div class="col-md-12">
        <section class="panel panel-default">
            <header class="panel-heading">
                {{ $frame['title'] }}
            </header>
            <table class="table table-striped m-b-none">
                <thead>
                <tr>
                    <th class="col-md-3">名称</th>
                    <th class="col-md-3">调用标签</th>
                    <th class="col-md-3">作者</th>
                    <th class="col-md-3">操作</th>
                </tr>
                </thead>
                <tbody>
                @if(!empty($boxes))
                    @foreach( $boxes as $box )
                        <tr>
                            <td>
                                <a href="{{ route('admin.box.box') }}?status={{ $box->id }}" class="m-r">
                                    @if( (bool)$box->status )
                                        <i class="fa-tags fa text-xs text-ff552e text-center-xs" title="内容盒子开启"></i>
                                    @else
                                        <i class="fa-tags fa text-xs text-no text-center-xs" title="内容盒子关闭"></i>
                                    @endif
                                </a>
                                {{ $box->name }}
                            </td>
                            <td>{{ '{' }}!! $box['<span class="text-info">{{ $box->path }}</span>'] !!}</td>
                            <td>{{ $box->author }}</td>
                            <td>
                                <a href="{{ route('admin.box.box_edit',$box->id) }}"
                                   class="btn btn-xs btn-default">编辑</a>
                                <a href="{{ route('admin.box.box') }}?del={{ $box->id }}"
                                   class="btn btn-xs btn-danger">删除</a>
                            </td>
                        </tr>
                    @endforeach
                @else
                    <tr>
                        <td>暂无内容盒子信息,请<a class="text-info">添加</a>!</td>
                    </tr>
                @endif
                </tbody>
            </table>
        </section>
    </div>
@endsection

@section('css')
@endsection

@section('js')
@endsection